#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using tl = tuple < int, int, int >;
using vec = vector < int >;
using veg = vector < pii >;

const int N = 110;

ll a[N];
int n;

ll lcm(ll x, ll y) { return x / __gcd(x, y) * y; }

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
	cin >> n; rep(i, 1, n) cin >> a[i];
	per(pos, n, 1) {
		int can = -1;
		rep(i, 1, pos) {
			ll v = 1;
			rep(j, 1, pos) if(j ^ i) v = lcm(v, __gcd(a[i], a[j]));
			if(v < a[i]) can = i;
		} if(can == -1) return puts("No"), 0; swap(a[pos], a[can]);
	}
	puts("Yes"); rep(i, 1, n) printf("%lld ", a[i]);
	return 0;
}
